<?php 

  include 'connect_database.php';
  function getPost(){
    $db  = connect();
      $result = mysqli_query($db,"SELECT * FROM post");
    $rows = array();

    while($row = mysqli_fetch_array($result)) {
  
	 	array_push($rows, $row);
   
	}
    echo json_encode($rows);

    close_connect($db);
  }
?>